package com.mayisoftware.mayioa.business.human.impl.serviceImpl.humanmanager;


import com.mayisoftware.mayioa.business.human.api.domain.humanmanager.HumanIpsaLeaveInfo;
import com.mayisoftware.mayioa.business.human.api.domain.humanmanager.HumanIpsaStaffInfo;
import com.mayisoftware.mayioa.business.human.api.domain.humanmanager.HumanOmpInfo;
import com.mayisoftware.mayioa.business.human.api.domain.humanmanager.HumanTurnOverInfo;
import com.mayisoftware.mayioa.business.human.api.service.IHCService;
import com.mayisoftware.mayioa.business.human.api.service.humanmanager.IHumanUploadService;
import com.mayisoftware.mayioa.business.human.impl.dao.humanmanager.HumanUploadMapper;
import com.mayisoftware.mayioa.common.impl.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


/**
 * 用户 业务层处理
 * 
 *
 */
@Service
public class HumanUploadServiceImpl implements IHumanUploadService
{
    @Autowired
    private HumanUploadMapper uploadMapper;

    @Autowired
    private IHCService hcService;
    @Override
    public List<HumanOmpInfo> getOmpInfos() {
        return null;
    }

    @Override
    public int importFileInfos(List<String> contents,String fileType) {
        if (contents == null){
            return 0;
        }

        int affectRows = 0;
        switch (fileType){
            case "0":
                affectRows = importTrunOverInfos(contents);
                break;
            case "1":
                affectRows = importOmpInfos(contents);
                break;
            case "2":
                affectRows = inmportIpsaStaffs(contents);
                break;
            case "3":
                affectRows = inmportIpsaLeaves(contents);
                break;
        }
       return  affectRows;
    }

    private int importTrunOverInfos(List<String> contents){
        List<HumanTurnOverInfo>  ipsaLeaveInfos = getTurnOverInfosByFile(contents);

        int affectRows = 0;
        for (HumanTurnOverInfo turnOverInfo:ipsaLeaveInfos) {
            int existCount = uploadMapper.isTurnOverInfoExist(turnOverInfo);
            if (existCount==0){
                uploadMapper.insertTurnOverInfo(turnOverInfo);
            }else{
                uploadMapper.updateTurnOverInfo(turnOverInfo);
            }
            affectRows++;
        }
        return affectRows;

    }
    private int inmportIpsaLeaves(List<String> contents){
        List<HumanIpsaLeaveInfo>  ipsaLeaveInfos = getIpsaLeaveInfosByFile(contents);

        int affectRows = 0;
        for (HumanIpsaLeaveInfo ompInfo:ipsaLeaveInfos) {
            int existCount = uploadMapper.isIpsaLeaveInfoExist(ompInfo);
            if (existCount==0){
                uploadMapper.insertIpsaLeaveInfo(ompInfo);
            }else{
                uploadMapper.updateIpsaLeaveInfo(ompInfo);
            }
            affectRows++;
        }
        return affectRows;
    }


    private int inmportIpsaStaffs(List<String> contents){
        List<HumanIpsaStaffInfo>  ipsaStaffInfos = getIpsaStaffInfosByFile(contents);

        int affectRows = 0;
        for (HumanIpsaStaffInfo ompInfo:ipsaStaffInfos) {
            int existCount = uploadMapper.isIpsaStaffInfoExist(ompInfo);
            if (existCount==0){
                uploadMapper.insertIpsaStaffInfo(ompInfo);
            }else{
                uploadMapper.updateIpsaStaffInfo(ompInfo);
            }
            affectRows++;
        }
        return affectRows;
    }

    private int importOmpInfos(List<String> contents){
        List<HumanOmpInfo>  ompInfos = getOmpInfosByFile(contents);

        int affectRows = 0;
        for (HumanOmpInfo ompInfo:ompInfos) {
            int existCount = uploadMapper.isOmpInfoExist(ompInfo);
            if (existCount==0){
                uploadMapper.insertOmpInfo(ompInfo);
            }else{
                uploadMapper.updateOmpInfo(ompInfo);
            }
            affectRows++;
        }
        return affectRows;
    }


    private List<HumanIpsaStaffInfo> getIpsaStaffInfosByFile(List<String> contents){
        List<HumanIpsaStaffInfo> ipsaStaffInfos = new ArrayList<>();
        int count = 0;
        for (String item: contents) {
            count++;
            if (count <= 1) {
                continue;
            }

            List<String> items = Arrays.asList(item.split(",",-1));
            if (items==null || items.size()==0){
                continue;
            }

            System.out.println("++++++++++++++++++"+item);
            HumanIpsaStaffInfo ipsaStaffInfo = new HumanIpsaStaffInfo();
            ipsaStaffInfo.setIsoftId(items.get(0));
            ipsaStaffInfo.setName(items.get(1));
            ipsaStaffInfo.setId(items.get(2));
            ipsaStaffInfo.setIsoftStatus(items.get(3));
            ipsaStaffInfo.setIsFrontline(items.get(4).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setPersonCat(items.get(5));
            ipsaStaffInfo.setHwLevelType(items.get(6));
            ipsaStaffInfo.setHwLevelclassify(items.get(7));
            ipsaStaffInfo.setHwLevel(items.get(8));
            ipsaStaffInfo.setIsBackbone(items.get(9).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setIsCoreBackbone(items.get(10).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setIsOnSite(items.get(11).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setOfficeSpace(items.get(12));
            ipsaStaffInfo.setStationNo(items.get(13));
            ipsaStaffInfo.setCooperateMode(items.get(14));
            ipsaStaffInfo.setCooperateType(items.get(15));
            ipsaStaffInfo.setRole(items.get(16));
            ipsaStaffInfo.setSkill(items.get(17));
            ipsaStaffInfo.setTechSkill(items.get(18));
            ipsaStaffInfo.setTechPlatform(items.get(19));
            ipsaStaffInfo.setTechLevel(items.get(20));
            ipsaStaffInfo.setPost(items.get(21));
            ipsaStaffInfo.setPostDuty(items.get(22));
            ipsaStaffInfo.setSupportDimension(items.get(23));
            ipsaStaffInfo.setSupportDeptCode(items.get(24));
            ipsaStaffInfo.setSupportDeptName(items.get(25));
            ipsaStaffInfo.setSupportRegion(items.get(26));
            ipsaStaffInfo.setPostBackupCode(items.get(27));
            ipsaStaffInfo.setPostBackupName(items.get(28));
            ipsaStaffInfo.setTutorName(items.get(29));
            ipsaStaffInfo.setTutorCode(items.get(30));
            ipsaStaffInfo.setIsInTutorResource(items.get(31).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setIsTutor(items.get(32).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setFirstEmergencyName(items.get(33));
            ipsaStaffInfo.setFirstEmergencyRelationship(items.get(34));
            ipsaStaffInfo.setFirstEmergencyPhone(items.get(35));
            ipsaStaffInfo.setPermanentAddress(items.get(36));
            ipsaStaffInfo.setPduManagerName(items.get(37));
            ipsaStaffInfo.setPduManagerCode(items.get(38));
            ipsaStaffInfo.setReportLeaderName(items.get(39));
            ipsaStaffInfo.setReportLeaderCode(items.get(40));
            ipsaStaffInfo.setHwAccount(items.get(41));
            ipsaStaffInfo.setHwEmail(items.get(42));
            ipsaStaffInfo.setHwPmName(items.get(43));
            ipsaStaffInfo.setHwPmCode(items.get(44));
            ipsaStaffInfo.setJoinDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(45)));
            ipsaStaffInfo.setLeaveDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(46)));
            ipsaStaffInfo.setGeneralPost(items.get(47));
            ipsaStaffInfo.setGeneralPostCode(items.get(48));
            ipsaStaffInfo.setCurrentPostDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(49)));
            ipsaStaffInfo.setOrgUnit1(items.get(50));
            ipsaStaffInfo.setOrgUnit2(items.get(51));
            ipsaStaffInfo.setOrgUnit3(items.get(52));
            ipsaStaffInfo.setOrgUnit4(items.get(53));
            ipsaStaffInfo.setOrgUnit5(items.get(54));
            ipsaStaffInfo.setOrgUnit6(items.get(55));
            ipsaStaffInfo.setCu(items.get(56));
            ipsaStaffInfo.setCuCode(items.get(57));
            ipsaStaffInfo.setCuPerson(items.get(58));
            ipsaStaffInfo.setCuAttr(items.get(59));
            ipsaStaffInfo.setPrjTeam(items.get(60));

            ipsaStaffInfo.setWbCode(items.get(61));
            ipsaStaffInfo.setDu(items.get(62));
            ipsaStaffInfo.setPdu(items.get(63));
            ipsaStaffInfo.setWorkplaceText(items.get(64));
            ipsaStaffInfo.setHumanScope(items.get(65));
            ipsaStaffInfo.setHumanSubScope(items.get(66));
            ipsaStaffInfo.setSex(items.get(67));
            ipsaStaffInfo.setCompanyMonths(items.get(68));
            ipsaStaffInfo.setCompanyYears(items.get(69));
            ipsaStaffInfo.setStaffAttr(items.get(70));
            ipsaStaffInfo.setStaffGroup(items.get(71));
            ipsaStaffInfo.setStaffSubGroup(items.get(72));
            ipsaStaffInfo.setRank(items.get(73));
            ipsaStaffInfo.setRankCode(items.get(74));
            ipsaStaffInfo.setStaffText(items.get(75));
            ipsaStaffInfo.setPostText(items.get(76));
            ipsaStaffInfo.setPostCode(items.get(77));
            ipsaStaffInfo.setPostName(items.get(78));
            ipsaStaffInfo.setBirthday(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(79)));
            ipsaStaffInfo.setAge(items.get(80));
            ipsaStaffInfo.setNationality(items.get(81));
            ipsaStaffInfo.setColleges(items.get(82));
            ipsaStaffInfo.setGraduationDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(83)));
            ipsaStaffInfo.setIsUnifiedRecruitment(items.get(84).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setEducation(items.get(85));
            ipsaStaffInfo.setDegree(items.get(86));
            ipsaStaffInfo.setIs211(items.get(87).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setIsNewEntry(items.get(88).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setMajor(items.get(89));
            ipsaStaffInfo.setCompanyStartDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(90)));
            ipsaStaffInfo.setStartWorkDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(91)));
            ipsaStaffInfo.setIsTryDate(items.get(92).equalsIgnoreCase("是")?1:0);
            ipsaStaffInfo.setTryDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(93)));
            ipsaStaffInfo.setWantRegularDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(94)));
            ipsaStaffInfo.setProtocolType(items.get(95));
            ipsaStaffInfo.setProtocolValidDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(96)));
            ipsaStaffInfo.setProtocolInvalidDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(97)));
            ipsaStaffInfo.setContractType(items.get(98));
            ipsaStaffInfo.setContractStartDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(99)));
            ipsaStaffInfo.setContractEndDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(100)));
            ipsaStaffInfo.setIsoftEmail(items.get(101));
            ipsaStaffInfo.setPhone(items.get(102));
            ipsaStaffInfo.setExtPhone(items.get(103));
            ipsaStaffInfo.setDomainUserName(items.get(104));
            ipsaStaffInfo.setNation(items.get(105));
            ipsaStaffInfo.setCompanyCode(items.get(106));
            ipsaStaffInfo.setCompanyName(items.get(107));
            ipsaStaffInfo.setOrgUnit1Code(items.get(108));
            ipsaStaffInfo.setOrgUnit2Code(items.get(109));
            ipsaStaffInfo.setOrgUnit3Code(items.get(110));
            ipsaStaffInfo.setOrgUnit4Code(items.get(111));
            ipsaStaffInfo.setOrgUnit5Code(items.get(112));
            ipsaStaffInfo.setOrgUnit6Code(items.get(113));
            ipsaStaffInfo.setMaritalStatus(items.get(114));
            ipsaStaffInfo.setHouseholdType(items.get(115));
            ipsaStaffInfo.setNativePlace(items.get(116));
            ipsaStaffInfo.setCurrentAddr(items.get(117));
            ipsaStaffInfo.setHouseholdAddr(items.get(118));
            ipsaStaffInfo.setErContactAddr(items.get(119));
            ipsaStaffInfo.setErContactName(items.get(120));
            ipsaStaffInfo.setErContactPhone(items.get(121));
            ipsaStaffInfo.setPoliticalOutlook(items.get(122));
            ipsaStaffInfo.setOperator(items.get(123));
            ipsaStaffInfo.setOperateTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(124)));
            ipsaStaffInfo.setApprovedBy(items.get(125));

            ipsaStaffInfos.add(ipsaStaffInfo);
        }

        return ipsaStaffInfos;
    }

    private List<HumanOmpInfo> getOmpInfosByFile(List<String> contents){
        List<HumanOmpInfo> ompInfos = new ArrayList<>();
        int count = 0;
        for (String item: contents) {
            count++;
            if (count <= 1) {
                continue;
            }

            List<String> items = Arrays.asList(item.split(",",-1));
            if (items==null || items.size()==0){
                continue;
            }

            HumanOmpInfo ompInfo = new HumanOmpInfo();
            ompInfo.setName(items.get(0));
            ompInfo.setSex(items.get(1));
            ompInfo.setId(items.get(2));
            ompInfo.setWbCode(items.get(3));
            ompInfo.setPrjPo(items.get(4));
            ompInfo.setPrjPr(items.get(5));
            ompInfo.setPrjNo(items.get(6));
            ompInfo.setPrjName(items.get(7));
            ompInfo.setOperatePattern(items.get(8));

            ompInfo.setPartnerName(items.get(9));
            ompInfo.setDeptName(items.get(10));
            ompInfo.setBg(items.get(11));
            ompInfo.setBu(items.get(12));
            ompInfo.setPdu(items.get(13));
            ompInfo.setRegion(items.get(14));
            ompInfo.setHwLevel(items.get(15));
            ompInfo.setLeaveType(items.get(16));

            ompInfo.setLevelDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(17)));
            ompInfo.setIsBackbone(items.get(18).equalsIgnoreCase("是")?1:0);
            ompInfo.setPartnerMode(items.get(19));
            ompInfo.setHwPm(items.get(20));
            ompInfo.setCurrentStatus(items.get(21));
            ompInfo.setInputType(items.get(22));
            ompInfo.setLeaveType(items.get(23));
            ompInfo.setLeaveDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(24)));
            ompInfo.setLeaveReason(items.get(25));
            ompInfo.setReleaseDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(26)));
            ompInfo.setReleaseReason(items.get(27));
            ompInfo.setHwAccount(items.get(28));
            ompInfo.setAccount(items.get(29));
            ompInfo.setPost(items.get(30));
            ompInfo.setSkill(items.get(31));
            ompInfo.setPersonCategory(items.get(32));
            ompInfo.setIsDevDept(items.get(33).equalsIgnoreCase("是")?1:0);
            ompInfo.setEducation(items.get(34));
            ompInfo.setGraduationTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(45)));
            ompInfo.setFirstEnterHwTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(36)));
            ompInfo.setColleges(items.get(37));
            ompInfo.setIsUnifiedRecruitment(items.get(38).equalsIgnoreCase("是")?1:0);
            ompInfo.setIs211(items.get(39).equalsIgnoreCase("是")?1:0);
            ompInfo.setMajor(items.get(40));
            ompInfo.setIsOnshore(items.get(41).equalsIgnoreCase("是")?1:0);
            ompInfo.setOfficeSpace(items.get(42));
            ompInfo.setPartnerPm(items.get(43));
            ompInfo.setProduct(items.get(44));
            ompInfo.setPrjTeam(items.get(45));
            ompInfo.setRemark(items.get(46));
            ompInfo.setCreateTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(47)));
            ompInfo.setLastWorkHourTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD_HH_MM_SS,items.get(48)));
            ompInfo.setIsException(items.get(49).equalsIgnoreCase("是")?1:0);
            ompInfo.setExceptionType(items.get(50));
            ompInfo.setCertificateNo(items.get(51));
            ompInfo.setCandidateStatus(items.get(52));
            ompInfos.add(ompInfo);
        }

        return ompInfos;
    }


    private List<HumanIpsaLeaveInfo> getIpsaLeaveInfosByFile(List<String> contents){
        List<HumanIpsaLeaveInfo> ipsaLeaveInfos = new ArrayList<>();
        int count = 0;
        for (String item: contents) {
            count++;
            if (count <= 1) {
                continue;
            }

            List<String> items = Arrays.asList(item.split(",",-1));
            if (items==null || items.size()==0){
                continue;
            }

            HumanIpsaLeaveInfo ipsaLeaveInfo = new HumanIpsaLeaveInfo();
            ipsaLeaveInfo.setIsoftId(items.get(0));
            ipsaLeaveInfo.setName(items.get(1));
            ipsaLeaveInfo.setIsFrontline(items.get(2).equalsIgnoreCase("是")?1:0);
            ipsaLeaveInfo.setIsChargeStaff(items.get(3).equalsIgnoreCase("是")?1:0);
            ipsaLeaveInfo.setNoChargeType(items.get(4));
            ipsaLeaveInfo.setNoChargeReason(items.get(5));
            ipsaLeaveInfo.setHwLevelType(items.get(6));
            ipsaLeaveInfo.setHwLevel(items.get(7));
            ipsaLeaveInfo.setIsBackbone(items.get(8).equalsIgnoreCase("是")?1:0);
            ipsaLeaveInfo.setRole(items.get(9));
            ipsaLeaveInfo.setReportLeaderName(items.get(10));
            ipsaLeaveInfo.setReportLeaderCode(items.get(11));
            ipsaLeaveInfo.setJoinDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(12)));
            ipsaLeaveInfo.setLeaveDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(13)));
            ipsaLeaveInfo.setLeaveFoundDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(14)));
            ipsaLeaveInfo.setLeaveType(items.get(15));
            ipsaLeaveInfo.setLeaveResonClassify(items.get(16));
            ipsaLeaveInfo.setLeaveReason(items.get(17));
            ipsaLeaveInfo.setLeaveReasonDetail(items.get(18));
            ipsaLeaveInfo.setIsLeaveConnect(items.get(19).equalsIgnoreCase("是")?1:0);
            ipsaLeaveInfo.setConnectReason(items.get(20));
            ipsaLeaveInfo.setConnectResult(items.get(21));
            ipsaLeaveInfo.setConnectName(items.get(22));
            ipsaLeaveInfo.setConnectCode(items.get(23));
            ipsaLeaveInfo.setConnectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(24)));
            ipsaLeaveInfo.setCuConnectReason(items.get(25));
            ipsaLeaveInfo.setCuConnectResult(items.get(26));
            ipsaLeaveInfo.setCuConnectName(items.get(27));
            ipsaLeaveInfo.setCuConnectCode(items.get(28));
            ipsaLeaveInfo.setCuConnectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(29)));
            ipsaLeaveInfo.setBuConncectReason(items.get(30));
            ipsaLeaveInfo.setBuConncectResult(items.get(31));
            ipsaLeaveInfo.setBuConncectName(items.get(32));
            ipsaLeaveInfo.setBuConncectCode(items.get(33));
            ipsaLeaveInfo.setBuConncectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(34)));
            ipsaLeaveInfo.setBuhrpConncectReason(items.get(35));
            ipsaLeaveInfo.setBuhrpConncectResult(items.get(36));
            ipsaLeaveInfo.setBuhrpConncectCity(items.get(37));
            ipsaLeaveInfo.setBuhrpConncectCompany(items.get(38));
            ipsaLeaveInfo.setBuhrpConncectSalary(items.get(39));
            ipsaLeaveInfo.setBuhrpConncectSuggestion(items.get(40));
            ipsaLeaveInfo.setBuhrpConncectName(items.get(41));
            ipsaLeaveInfo.setBuhrpConncectCode(items.get(42));
            ipsaLeaveInfo.setBuhrpConncectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(43)));
            ipsaLeaveInfo.setBdConncectReason(items.get(44));
            ipsaLeaveInfo.setBdConncectResult(items.get(45));
            ipsaLeaveInfo.setBdConncectName(items.get(46));
            ipsaLeaveInfo.setBdConncectCode(items.get(47));
            ipsaLeaveInfo.setBdConncectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(48)));
            ipsaLeaveInfo.setBdhrpConncectReason(items.get(49));
            ipsaLeaveInfo.setBdhrpConncectResult(items.get(50));
            ipsaLeaveInfo.setBdhrpConncectCity(items.get(51));
            ipsaLeaveInfo.setBdhrpConncectCompany(items.get(52));
            ipsaLeaveInfo.setBdhrpConncectSalary(items.get(53));
            ipsaLeaveInfo.setBdhrpConncectSuggestion(items.get(54));
            ipsaLeaveInfo.setBdhrpConncectName(items.get(55));
            ipsaLeaveInfo.setBdhrpConncectCode(items.get(56));
            ipsaLeaveInfo.setBdhrpConncectDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(57)));
            ipsaLeaveInfo.setOrgUnit1(items.get(58));
            ipsaLeaveInfo.setOrgUnit2(items.get(59));
            ipsaLeaveInfo.setOrgUnit3(items.get(60));
            ipsaLeaveInfo.setOrgUnit4(items.get(61));
            ipsaLeaveInfo.setOrgUnit5(items.get(62));
            ipsaLeaveInfo.setOrgUnit6(items.get(63));
            ipsaLeaveInfo.setCu(items.get(64));
            ipsaLeaveInfo.setCuPerson(items.get(65));
            ipsaLeaveInfo.setWorkplaceText(items.get(66));
            ipsaLeaveInfo.setCompanyMonths(items.get(67));
            ipsaLeaveInfo.setCompanyYears(items.get(68));
            ipsaLeaveInfo.setStaffGroup(items.get(69));
            ipsaLeaveInfo.setStaffSubGroup(items.get(70));
            ipsaLeaveInfo.setGeneralPost(items.get(71));
            ipsaLeaveInfo.setGeneralPostCode(items.get(72));
            ipsaLeaveInfo.setRank(items.get(73));
            ipsaLeaveInfo.setRankCode(items.get(74));

            ipsaLeaveInfos.add(ipsaLeaveInfo);
        }

        return ipsaLeaveInfos;
    }

    private List<HumanTurnOverInfo> getTurnOverInfosByFile(List<String> contents){
        List<HumanTurnOverInfo> turnOverInfos = new ArrayList<>();
        int count = 0;
        for (String item: contents) {
            count++;
            if (count <= 1) {
                continue;
            }

            List<String> items = Arrays.asList(item.split(",",-1));
            if (items==null || items.size()==0){
                continue;
            }

            HumanTurnOverInfo turnOverInfo = new HumanTurnOverInfo();
            turnOverInfo.setName(items.get(0));
            turnOverInfo.setSex(items.get(1));
            turnOverInfo.setId(items.get(2));
            turnOverInfo.setCheckPeriod(hcService.getDictValue("check_period",items.get(3)));
            turnOverInfo.setWbCode(items.get(4));
            turnOverInfo.setIsoftId(items.get(5));
            turnOverInfo.setCu(items.get(6));
            turnOverInfo.setLocDept(items.get(7));
            turnOverInfo.setCheckUnit(hcService.getDictValue("check_unit",items.get(8)));
            turnOverInfo.setDeliverDept(hcService.getDictValue("deliver_dept_type",items.get(9)));

            turnOverInfo.setCurrentStatus(items.get(10));
            turnOverInfo.setPrjPo(items.get(11));
            turnOverInfo.setPrjPr(items.get(12));
            turnOverInfo.setPrjNo(items.get(13));
            turnOverInfo.setPrjName(items.get(14));
            turnOverInfo.setPartnerName(items.get(15));
            turnOverInfo.setDeptName(items.get(16));
            turnOverInfo.setBg(items.get(17));
            turnOverInfo.setBu(items.get(18));
            turnOverInfo.setPdu(hcService.getDictValue("human_pdu",items.get(19)));
            turnOverInfo.setRegion(hcService.getDictValue("check_region",items.get(20)));
            turnOverInfo.setHwLevel(items.get(21));
            turnOverInfo.setLevelType(items.get(22));
            turnOverInfo.setLevelDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(23)));
            turnOverInfo.setIsBackbone(items.get(24).equalsIgnoreCase("是")?1:0);
            turnOverInfo.setPartnerMode(items.get(25));
            turnOverInfo.setHwPm(items.get(26));
            turnOverInfo.setInputType(items.get(27));
            turnOverInfo.setLeaveType(items.get(28));
            turnOverInfo.setLeaveDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(29)));
            turnOverInfo.setLeaveReason(items.get(30));
            turnOverInfo.setReleaseDate(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(31)));
            turnOverInfo.setReleaseReason(items.get(32));
            turnOverInfo.setHwAccount(items.get(33));
            turnOverInfo.setAccount(items.get(34));
            turnOverInfo.setPost(items.get(35));
            turnOverInfo.setSkill(items.get(36));
            turnOverInfo.setPersonCategory(items.get(37));
            turnOverInfo.setIsDevDept(items.get(38).equalsIgnoreCase("是")?1:0);
            turnOverInfo.setEducation(items.get(39));
            turnOverInfo.setGraduationTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(40)));
            turnOverInfo.setFirstEnterHwTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD,items.get(41)));
            turnOverInfo.setColleges(items.get(42));
            turnOverInfo.setIsUnifiedRecruitment(items.get(43).equalsIgnoreCase("是")?1:0);
            turnOverInfo.setIs211(items.get(44).equalsIgnoreCase("是")?1:0);
            turnOverInfo.setMajor(items.get(45));
            turnOverInfo.setIsOnshore(items.get(46).equalsIgnoreCase("是")?1:0);
            turnOverInfo.setOfficeSpace(items.get(47));
            turnOverInfo.setPartnerPm(items.get(48));
            turnOverInfo.setProduct(items.get(49));
            turnOverInfo.setPrjTeam(items.get(50));
            turnOverInfo.setRemark(items.get(51));
            turnOverInfo.setCreateTime(DateUtils.covertToDate(DateUtils.YYYY_MM_DD_HH_MM_SS,items.get(52)));

            turnOverInfos.add(turnOverInfo);
        }

        return turnOverInfos;
    }


}



